<link href="<?php echo LINK_ROOT . DIR_LAYOUT_CSS; ?>/navbar.css" rel="stylesheet" />
<?php
require_once DOCUMENT_ROOT . DIR_SHARED_DAO . "dao_conferences.php";
require_once DOCUMENT_ROOT . DIR_SHARED_DAO . "dao_news.php";
require_once DOCUMENT_ROOT . DIR_SHARED_DAO . "dao_adbox.php";

$conferences_access = new dao_conferences();
$news_access = new dao_news();
$dao_adbox = new dao_adbox();

$item = $dao_adbox->get();
?>
<div class="ad_box">
    <?php
    if (!empty($item)) {
        ?>
        <a href="<?php echo $item['url'] ?>" target="_blank">
            <img src="<?php echo LINK_ROOT . DIR_SHARED_UPLOAD_ADBOX . $item['img'] ?>" alt="<?php echo $item['img'] ?>" style="height: 250px; width: 250px"/>
        </a>
        <?php
    }
    ?>
</div>

<div class="NewArea jump">
    <div>
        <div id="news">
            <h3>Conference Box</h3>
            <marquee behavior="scroll" height="140" scrollamount="2" direction="up" onmouseover="this.stop();" onmouseout="this.start();">
                <table id="MainContent_DataList1" cellspacing="0" style="width:171px;border-collapse:collapse;">
                    <tbody>
                        <?php
                        $alert_conference = $conferences_access->get_lastest_ones(5);
                        if (!empty($alert_conference) && sizeof($alert_conference) > 0) {
                            foreach ($alert_conference as $i => $item) {
                                ?>
                                <tr>
                                    <td>
                                        <a id="MainContent_DataList1_HyperLink3_0" href="<?php echo LINK_ROOT . "/conference.php?conference_id=" . $item['conference_id'] ?>" style="color:White;"><?php echo $item['conference_name']; ?></a> 
                                    </td>
                                </tr>
                                <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </marquee>
        </div>
    </div>
</div>


<div class="NewArea jump">
    <div>
        <div id="news">
            <h3>Latest News</h3>
            <marquee behavior="scroll" height="140" scrollamount="2" direction="up" onmouseover="this.stop();" onmouseout="this.start();">
                <table id="MainContent_DataList1" cellspacing="0" style="width:171px;border-collapse:collapse;">
                    <tbody>
                        <?php
                        $alert_news = $news_access->get_lastest_ones(5);
                        if (!empty($alert_news) && sizeof($alert_news) > 0) {
                            foreach ($alert_news as $i => $item) {
                                ?>
                                <tr>
                                    <td>
                                        <a id="MainContent_DataList1_HyperLink3_0" href="<?php echo LINK_ROOT . "/news_list.php?news_id=" . $item['News_Id'] ?>" style="color:White;"><?php echo $item['News_Title']; ?></a> 
                                    </td>
                                </tr>
                                <?php
                            }
                        }
                        ?>
                    </tbody>
                </table>
            </marquee>
        </div>
    </div>
</div>